Fix the cirrus vga model to not leak memory when switching between
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 12 May 2006 14:17:21 +0000 (15:17 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 12 May 2006 14:17:21 +0000 (15:17 +0100)
commit17af31bde615d3655b2659319d3d8d6b6e3b3e73
tree8a48d7f59a0a23465961f180d89e548baecfe905
parent4b769f4b6160f8a43856940f38ea44b66e339443
Fix the cirrus vga model to not leak memory when switching between
initial vga mode and linear framebuffer.

When creating device model, the vga memory is allocated through
xc_domain_memory_increase_reservation(), however, when switch to use
linear framebuffer, we didn't free that memory, and re-allocate the vga
memory through set_mm_mapping(), that caused memory leak. Now it is
changed to just using qemu_malloc when create device model, and free
that memory when switch to linear framebuffer.

After unset_vram_mapping(), the old memory pointer should be
unmapped; after set_vram_mapping(), the old memory should be freed.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
tools/ioemu/hw/cirrus_vga.c
tools/ioemu/hw/pc.c
tools/ioemu/hw/vga.c
tools/ioemu/hw/vga_int.h
tools/ioemu/vl.c